home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / picture / error.c < prev    next >
Text File  |  1993-09-23  |  882b  |  40 lines

  1. //    Copyright 1993 Ralph Gonzalez
  2.  
  3. /*
  4. *    FILE:        error.c
  5. *    AUTHOR:        R. Gonzalez
  6. *    CREATED:    October 6, 1990
  7. *
  8. *    methods for error class, for reporting errors.
  9. */
  10.  
  11. # include    "error.h"
  12. # include    <stdlib.h>
  13. # include    <stdio.h>
  14. # include    <string.h>
  15.  
  16. /******************************************************************
  17. *    initialize
  18. ******************************************************************/
  19. Error::Error(void)
  20. {
  21.     error_file = fopen("error.fil","w");
  22. }
  23.  
  24. /******************************************************************
  25. *    report error
  26. ******************************************************************/
  27. void    Error::report(char *error_string)
  28. {
  29.     fprintf(error_file,"%s\n",error_string);
  30. }
  31.  
  32. /******************************************************************
  33. *    destroy
  34. ******************************************************************/
  35. Error::~Error(void)
  36. {
  37.     fclose(error_file);
  38. }
  39.  
  40.